extends GPUParticles2D


func set_power(rate: float):
	var material := process_material as ParticleProcessMaterial
	speed_scale = 1.0 + 2.0 * rate
	
	
	#var target_amount = min_amount + (max_amount - min_amount) * rate
	#target_amount = clamp(target_amount, min_amount, max_amount)
	#amount = target_amount
	#
	#var target_gravity = min_gravity + (max_gravity - min_gravity) * rate
	#target_gravity = clamp(target_gravity, max_gravity, min_gravity)
	#var material = process_material as ParticleProcessMaterial
	#material.gravity = Vector3(0, target_gravity, 0)

func stop_and_destroy_delay(time: float):
	emitting = false
	await get_tree().create_timer(time).timeout
	queue_free()
